async function getNotes () {
    let url = '/note';
    try {
        let response = await fetch(url)
        return await response.json();
    }catch(err){
        console.log(err)
    }
}

async function renderNotes () {
    let data = await getNotes();
    let html = ''

    for (i in data) {
        list = `
            <h4>${data[i].judul}</h4>
                ${data[i].isi}
        `;
        var md = window.markdownit({
            html: true,
            linkify: true,
            typographer: true
        });
        var result = md.renderInline(list)
        html += result
    }

    let el = document.querySelector('.notes_list')
    el.innerHTML = html;
}


renderNotes();